#ifndef SANGAME_HISTORY_INDICATOR_H_
#define SANGAME_HISTORY_INDICATOR_H_

namespace sangame {
namespace history {

class CHistoryView;

class Indicator : public base::MessageLoop {
public:
    Indicator();

    #pragma region SG Message

public:
    BOOL OnSGSetRect(SGRect* rect_param);
    BOOL OnSGMessage(int message_type, int param_type, void* param_data);

private:
    BOOL OnSGInitContext(SGContext* context_param);
    BOOL OnSGChangeGoods(SGGoodsChange* goods_change_param);
    BOOL OnSGSyncData(SGRange<uint64_t>* range_param);
    BOOL OnSGDrawBack(SGCanvas* canvas_param);
    BOOL OnSGDrawFore(SGCanvas* canvas_param);
    BOOL OnSGUpdateAxes();

    #pragma endregion

    #pragma region XMLString Status

public:
    BOOL LoadXml(std::string& xml);
    BOOL SaveXml(std::string& xml);
    int GetStatusID();
    void OnStatusUpdate();

    struct Status {
        SGIndicator::Type m_nType;
        bool m_bSelected;
        std::string m_strIndicator;
        std::string m_strParam;
        uint32_t m_nOverlayGoods;
    } m_tStatus;

    #pragma endregion

    #pragma region SG Data

public:
    CHistoryView* GetView();
    CAxes& GetAxes();

private:
    std::shared_ptr<IndicatorBase> m_pIndicatorBase;
    CAxes m_tAxes;

    #pragma endregion

};

} // nameaspace history
} // namespace sangame

#endif //SANGAME_HISTORY_INDICATOR_H_